UpdateBackInfoWindow = function(){
	var this_window = this;
	
	this.setData = function(data){
		form.form.setValues(data);
	};
	
	var save = function(){
		if(!form.form.isValid()){
			return false;
		}
		var params = form.form.getFieldValues();
		params["type"]= "back";
		Ajax({
			url : "item/update.action",
			params : params,
			maskTarget : this_window,
			window : this_window,
			success : function(){
//				setDetailPanel.getTopToolbar().init();
			}
		});
	};
	
	var form = new Ext.form.FormPanel({
		padding : 5,
		frame : true,
		labelAlign : "right",
		labelWidth : 60,
		items : [{
			xtype : "fieldset",
			title : "回款信息",
			defaults : {
				anchor : "95%",
				allowBlank : false
			},
			items : [ {
				xtype : 'hidden',
				name : "item.id"
			},{
				fieldLabel : "回款日期",
				name : "item.backDate",
				xtype : "datefield",
				format : "Y/m/d"
			},{
				fieldLabel : "超期(日)",
				name : "item.outDay",
				xtype : "numberfield",
				allowNegative : false,
				allowDecimals : false
			}]
		}]
	});
	
	
	UpdateBackInfoWindow.superclass.constructor.call(this, {
		title : "更新回款信息",
		width : 350,
		iconCls : "edit",
		border : false,
		autoHeight : true,
		closeAction : "hide",
		modal : true,
		items : [form],
		buttons : [{
			text : "保存",
			handler : save
		},{
			text : "取消",
			handler : function(){
				this_window.hide();
			}
		}]
	});
};
Ext.extend(UpdateBackInfoWindow, Ext.Window);
var updateBackInfoWindow = new UpdateBackInfoWindow();